package com.baofang.bao.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baofang.bao.entity.ComProducts;
import com.baofang.bao.repository.ComProductsRepository;
@Service
public class ComProductsServiceImpl implements IcomProductsService {
	@Autowired
	private ComProductsRepository comproductsrepository;
	
	public List<ComProducts> getUsers(){
		return comproductsrepository.findAll();
	}
	
	public ComProducts getUserById(Long id) {
		return comproductsrepository.getOne(id);
	}
	
	public ComProducts saveUser(ComProducts comProducts) {
		return comproductsrepository.saveAndFlush(comProducts);
	}
}
